{
render_area.width = data->size;
- background_area.width = render_area.height;
+ background_area.width = render_area.width;
background_area.x = render_area.x;
if (i == 0)
/* Cache the per-row sizes and allocate the iter */
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- gtk_cell_area_iter_allocate_width (priv->iter, allocation->width);
- get_row_sizes (scaffold, priv->row_data, allocation->width);
+ gtk_cell_area_iter_allocate_width (priv->iter, allocation->width - priv->indent);
+ get_row_sizes (scaffold, priv->row_data, allocation->width - priv->indent);
}
else
{
- gtk_cell_area_iter_allocate_height (priv->iter, allocation->height);
- get_row_sizes (scaffold, priv->row_data, allocation->height);
+ gtk_cell_area_iter_allocate_height (priv->iter, allocation->height - priv->indent);
+ get_row_sizes (scaffold, priv->row_data, allocation->height - priv->indent);
}
}
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Alice in wonderland",
SIMPLE_COLUMN_ICON, "gtk-execute",
- SIMPLE_COLUMN_DESCRIPTION, "One pill makes you smaller and the other pill makes you tall",
- -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- SIMPLE_COLUMN_NAME, "Highschool Principal",
- SIMPLE_COLUMN_ICON, "gtk-help",
SIMPLE_COLUMN_DESCRIPTION,
- "Will make you copy the dictionary if you dont like your math teacher",
+ "Twas brillig, and the slithy toves "
+ "did gyre and gimble in the wabe; "
+ "all mimsy were the borogoves, "
+ "and the mome raths outgrabe",
-1);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "George Bush",
SIMPLE_COLUMN_ICON, "gtk-dialog-warning",
- SIMPLE_COLUMN_DESCRIPTION, "Please hide your nuclear weapons when inviting "
- "him to dinner",
+ SIMPLE_COLUMN_DESCRIPTION, "It's a very good question, very direct, "
+ "and I'm not going to answer it",
-1);
gtk_list_store_append (store, &iter);
"is tiggers are wonderful things",
-1);
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ SIMPLE_COLUMN_NAME, "Aleister Crowley",
+ SIMPLE_COLUMN_ICON, "gtk-about",
+ SIMPLE_COLUMN_DESCRIPTION,
+ "Thou shalt do what thou wilt shall be the whole of the law",
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ SIMPLE_COLUMN_NAME, "Mark Twain",
+ SIMPLE_COLUMN_ICON, "gtk-quit",
+ SIMPLE_COLUMN_DESCRIPTION,
+ "Giving up smoking is the easiest thing in the world. "
+ "I know because I've done it thousands of times.",
+ -1);
+
+
return (GtkTreeModel *)store;
}
}
static GtkWidget *
-focus_scaffold (gboolean color_bg)
+focus_scaffold (gboolean color_bg, GtkCellRenderer **focus, GtkCellRenderer **sibling)
{
GtkTreeModel *model;
GtkWidget *scaffold;
if (color_bg)
g_object_set (G_OBJECT (renderer), "cell-background", "green", NULL);
- else
- focus_renderer = renderer;
+
+ if (focus)
+ *focus = renderer;
g_signal_connect (G_OBJECT (renderer), "toggled",
G_CALLBACK (cell_toggled), scaffold);
if (color_bg)
g_object_set (G_OBJECT (renderer), "cell-background", "blue", NULL);
- else
- sibling_renderer = renderer;
+
+ if (sibling)
+ *sibling = renderer;
gtk_cell_area_box_pack_start (GTK_CELL_AREA_BOX (area), renderer, FALSE, TRUE);
gtk_cell_area_attribute_connect (area, renderer, "text", FOCUS_COLUMN_STATIC_TEXT);
gtk_window_set_title (GTK_WINDOW (window), "Focus and editable cells");
- scaffold = focus_scaffold (FALSE);
+ scaffold = focus_scaffold (FALSE, &focus_renderer, &sibling_renderer);
frame = gtk_frame_new (NULL);
gtk_widget_show (frame);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 0);
- scaffold = focus_scaffold (TRUE);
+ scaffold = focus_scaffold (TRUE, NULL, NULL);
frame = gtk_frame_new (NULL);
gtk_widget_show (frame);